﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Netfraction
{
    public class ConnectionUIManager
    {
        //public static Dictionary<DCSharp.Identity, DCSharp.Backend.Managers.Downloader> downloaders = new Dictionary<DCSharp.Identity,DCSharp.Backend.Managers.Downloader>();
        //public static System.Collections.Generic.Queue<DCSharp.Backend.Managers.Downloader> downloaders = new Queue<DCSharp.Backend.Managers.Downloader>();
        /*public static System.Collections.Generic.List<DCSharp.Backend.Managers.Downloader> downloaders = new List<DCSharp.Backend.Managers.Downloader>();

        public static void ConnectionManager_UserDisconnected(object sender, DCSharp.Backend.Connections.ConnectionEventArgs e)
        {
            Console.WriteLine("cm user disconnected");
        }

        public static void ConnectionManager_UserIdle(object sender, DCSharp.UserEventArgs e)
        {
            Console.WriteLine("cm user idle");
        }

        public static void ConnectionManager_UserConnected(object sender, DCSharp.Backend.Connections.ConnectionEventArgs e)
        {
            Console.WriteLine("cm user connected");
        }

        public static void UploadManager_UploadAborted(object sender, DCSharp.Backend.Objects.UploadEventArgs e)
        {
            Console.WriteLine("um upload aborted");
        }

        public static void UploadManager_UploadCompleted(object sender, DCSharp.Backend.Objects.UploadEventArgs e)
        {
            Console.WriteLine("um upload completed");
        }

        public static void UploadManager_UploadStarted(object sender, DCSharp.Backend.Objects.UploadEventArgs e)
        {
            Console.WriteLine("um upload started");
        }

        public static void DownloadManager_DownloaderRemoved(object sender, DCSharp.Backend.Managers.DownloadEventArgs e)
        {
            Console.WriteLine("dm downloader removed");
            downloaders.Remove(e.Downloader);
        }

        public static void DownloadManager_DownloaderAdded(object sender, DCSharp.Backend.Managers.DownloadEventArgs e)
        {
            Console.WriteLine("dm downloader added");
            downloaders.Add(e.Downloader);
            e.Downloader.StateChanged += new EventHandler(Downloader_StateChanged);
            e.Downloader.ConnectionRequest+=new EventHandler<DCSharp.Backend.Managers.ConnectionRequestEventArgs>(Downloader_ConnectionRequest);
        }

        static void Downloader_StateChanged(object sender, EventArgs e)
        {
            Console.WriteLine("state changed");
            Console.WriteLine((sender as DCSharp.Backend.Managers.Downloader).State);
        }

        static void Downloader_ConnectionRequest(object sender, DCSharp.Backend.Managers.ConnectionRequestEventArgs e)
        {
            //downloaders.Add(e.User, (sender as DCSharp.Backend.Managers.Downloader));
            //downloaders.Add(sender as DCSharp.Backend.Managers.Downloader);
            //throw new NotImplementedException();
        }*/
    }
}
